package com.lagou.demo.dao;

import com.lagou.demo.pojo.Novel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * @Author : liuchangling
 * @Descrition :
 * @Date： Created in 3:23 下午 2021/10/29
 */
@Mapper
@Component
public interface NovelDao {
    /**
     * 新增
     * */
    @Insert("insert into novel(id,title,author,pic,content) values(#{id},#{title},#{author},#{pic},#{content})")
    int insertNovel(Novel novel);

    /**
     * 查询
     * */
    @Select({"select * from novel where id = #{id}"})
    Novel findNovelById(@Param("id") Long id);
}
